<template>
	<view>
		<template v-if="list.length > 0">
		<block v-for="(item,index) in list" :key="index">
			<msg-list :item="item" :index="index"></msg-list>
		</block>
		</template>
		<template v-else>
			<no-thing></no-thing>
		</template>
		
	</view>
</template>

<script>
	const demo = [
		{
			avatar:'/static/demo/datapic/1.jpg',
			username:'kk的皮皮浩',
			update_time:1570718427,
			data:'好饿',
			noread:'1'
		},
		{
			avatar:'/static/demo/datapic/1.jpg',
			username:'kk的皮皮浩',
			update_time:1570718427,
			data:'好饿',
			noread:'1'
		},
		{
			avatar:'/static/demo/datapic/1.jpg',
			username:'kk的皮皮浩',
			update_time:1570718427,
			data:'好饿',
			noread:'1'
		}
	] 
	import msgList from '@/components/msg/msg-list.vue'
	import noThing from '@/components/common/no-thing.vue'
	export default {
		components:{
			msgList,
			noThing
		},
		data() {
			return {
				list:[]
			}
		},
		// 页面加载
		onLoad() {
			this.list = demo
		},
		// 下拉刷新
		onPullDownRefresh() {
			this.refresh()
		},
		methods: {
			refresh(){
				setTimeout(() => {
					this.list = demo
					uni.stopPullDownRefresh()
				},2000)
			}
		}
	}
</script>

<style>

</style>
